package com.qf.dao;


import com.qf.etype.UserdetailDto;
import com.qf.pojo.Userdetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lzy
 * @since 2020-11-28
 */
@Repository
public interface UserdetailDao  {

    @Insert("insert into t_userdetail (uid,flag) values(#{uid},1)")
    int insertInit(int uid);


    @Update("update t_userdetail set image_url =#{imageUrl},nickname=#{nickname},sex=#{sex},birthday=#{birthday}," +
            "address=#{address},description=#{description} where uid=#{uid}")
    int updateByUid(int uid, UserdetailDto userdetailDto);

    @Select("select * from t_userdetail where uid=#{uid}")
    Userdetail selectByUid(int uid);


}
